from selenium import webdriver
from selenium.webdriver.chrome.webdriver import WebDriver


class BasePage:
    _base_url = ""

    def __init__(self, driver: WebDriver = None):

        if driver == None:
            self._driver = webdriver.Chrome()
        else:
            self._driver = driver

        self._driver.maximize_window()
        self._driver.implicitly_wait(4)

        if self._base_url != "":
            self._driver.get(self._base_url)


    def find(self,by,locator):
        return self._driver.find_element(by,locator)